Skip to content

✨[Feat] Sprint 1 Bounded Binary Core and Format Detection - #2

Merged
maruson08 merged 4 commits into
mainfrom
feat/sprint-1-binary-core-format-detection
Aug 24, 2026
Merged

✨[Feat] Sprint 1 Bounded Binary Core and Format Detection#2
maruson08 merged 4 commits into
mainfrom
feat/sprint-1-binary-core-format-detection

Conversation

@maruson08

Copy link
Copy Markdown
Member

Summary

  • add centralized safe-integer range validation with subtraction-based capacity checks
  • add a read-only ByteReader for u8, endian-aware u16/u32, bounded subarray views, and allocation-free signature matching
  • normalize ArrayBuffer and exact Uint8Array views without copying or widening caller ranges
  • detect JPEG from FF D8, PNG from its complete eight-byte signature, and WebP from RIFF....WEBP
  • integrate maxInputBytes enforcement and format detection into inspectMetadata
  • mark reports as format-only so empty entries never claim metadata is absent
  • preserve deterministic NOT_IMPLEMENTED behavior for cleaning and verification

Tests

  • 7 test files, 68 tests passed
  • valid and invalid byte-reader boundaries, including unsigned u32 maximum
  • sliced Uint8Array backing-buffer regression coverage
  • JPEG, PNG, WebP, truncated-signature, and arbitrary RIFF cases
  • deterministic malformed inputs, input limits, input preservation, and repeatability

Deferred

No segment or chunk traversal, RIFF-size validation, CRC checking, EXIF/TIFF/GPS/XMP/IPTC/ICC decoding, metadata cleaning, rewriting, decompression, image decoding, fuzzing, UI, Rust, or WASM is included.

Validation

  • npm run format:check — passed
  • npm run lint — passed
  • npm run typecheck — passed
  • npm test — 7 files, 68 tests passed
  • npm run build — ESM, source map, and declarations built
  • npm audit — 0 vulnerabilities
  • npm ls --omit=dev --depth=0 — 0 runtime dependencies
  • npm pack --dry-run — expected 7-file, 8.1 kB package payload

Security review

All DataView reads follow project-owned bounds validation. Range capacity is checked with subtraction before any validated addition or direct byte indexing. Input normalization makes no whole-input copies, inspector code performs no writes, and source code introduces no network, filesystem, DOM, or Node-runtime dependency.

@maruson08
maruson08 merged commit 572ba0f into main Aug 24, 2026
1 check passed
@maruson08
maruson08 deleted the feat/sprint-1-binary-core-format-detection branch August 24, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant